const mysql = require("mysql");

module.exports=(sql,params=[])=>{
    const content = mysql.createConnection({
        host:"localhost",
        user:"root",
        password:"root",
        database:"1803b"
    })
    content.connect();

    return new Promise((resolve,reject)=>{
        content.query(sql,params,(err,data)=>{
            if(err){
                reject(err)
            }else{
                resolve(data)
            }
        })
    })
}